﻿//Copyright (C) <2013>  <jonathan cleeve norton> All Rights Reserved 
//Contact jon.norton@fin-plus.co.uk website <http://www.fin-plus.co.uk/>
using FinPlusCompCore;
using QLNet;

namespace FinPlusCompQuant 
{
    public class BondEngine : FinPlusComponent
    {
        public DiscountingBondEngine DiscountingBondEngine { get; private set; }

        //construct
        public BondEngine(Market market, string curveName, string discountCurveName)
        {
            var pricingLinkCurve = market.GetLinkedCurve(curveName);
            var discountLinkCurve = market.GetLinkedCurve(discountCurveName);
            var pricingCurve = market.GetCurve(curveName);
            var discountCurve = market.GetCurve(discountCurveName);

            DiscountingBondEngine = new DiscountingBondEngine(discountLinkCurve);
            market.SetEngine(curveName, DiscountingBondEngine);
            pricingLinkCurve.linkTo(discountCurve);
            discountLinkCurve.linkTo(pricingCurve);
        }

        //TODO Get results

        //TODO Get Bps
    }
}
